<template>
	<div>
		<div class="body">
			<!-- 头部 -->
			<div class="top">
				<div class="left">
					<div class="header">
						<img
							:src="item.headimgurl"
						/>
					</div>
					<div class="tit">
						<span style="color: #4395f5; font-size: 14px">{{item.contacts}}</span>
						<div class="tag">
							<span v-show="item.stTop==1?true:false">置顶</span>
							<span class="feature">{{getTypes(item.type)}}</span>
						</div>
					</div>
				</div>
				<div class="right">
					<a>
						<span class="tel">
							<img src="http://xj.dooop.top/themes/info/images/phonegb.gif" />
							<span>拨打电话</span>
						</span>
					</a>
				</div>
			</div>
			<!-- 内容 -->
			<div>
				<div class="content">
					<p>{{item.description}}</p>
				</div>
				<van-grid :column-num="4">
					<van-grid-item
						icon="https://image.chwlsq.com/4187/info/11522300_2202031143365207745.jpgthumb.jpg?x-oss-process=image/resize,m_fill,h_150,w_150"
						width="100%"
					/>
					<van-grid-item
						icon="https://image.chwlsq.com/4187/info/11522300_2202031143340988882.jpgthumb.jpg?x-oss-process=image/resize,m_fill,h_150,w_150"
						width="100%"
					/>
				</van-grid>
			</div>
			<div class="time">
				<span>{{getTime(item.createTime)}}</span>
				<span>查看详情>></span>
			</div>
			<!--底部评论转发 -->
			<div>
				<div class="triangle-up"></div>
				<div class="bottom">
					<div class="item">
						<img
							style="width: 16px; height: 16px"
							src="http://xj.dooop.top/themes/info/images/liulan.png"
						/>
						<i class="yanse">{{item.viewCount}}</i>人浏览
					</div>
					<div class="item">
						<img
							style="width: 16px; height: 16px"
							src="http://xj.dooop.top/themes/info/images/zan1.png"
						/>
						<i class="yanse">166</i>人点赞
					</div>
					<div class="item">
						<img
							style="width: 16px; height: 16px"
							src="http://xj.dooop.top/themes/info/images/zhuan.png"
						/>
						<i class="yanse">{{item.shareCount}}</i>人扩散
					</div>
				</div>
			</div>
		</div>
	</div>
</template>
<script>
import { getDateDiff , getType} from '@/utils/common'
export default {
	props: {
		item: {
			type: Object,
			default: () => {
				return {}
			}
		}
	},
	methods: {
    	getTypes (num) {
			var type = getType(num)
			return type;
		},
		getTime (time) {
			var result = getDateDiff(time)
      return result;

		}
	}
};
</script>

<style scoped>
p {
	padding: 0;
	margin: 0;
}
ol {
	padding: 0;
	margin: 0;
}
.body {
	margin-left: 3%;
	margin-right: 3%;
}
/*  头部  */
.top {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	padding-top: 20px;
	padding-bottom: 10px;
}
.top .left {
	display: flex;
	flex-direction: row;
}
.left .header > img {
	width: 50px;
	height: 50px;
}
.left .tit {
	margin-left: 10px;
}
.left .tit .tag > span {
	background-color: #ff8e14;
	color: #fff;
	font-size: 12px;
	padding: 0 3px;
	height: 19px;
	line-height: 19px;
	border-radius: 3px;
	margin-right: 5px;
}
.left .tit .tag .feature {
	background-color: #1ddc9b;
}
.right {
	width: 88px;
	height: 30px;
	background: #ed414a;
	border-radius: 3px;
}
.tel > img {
	width: 22px;
	position: relative;
	top: 4px;
	margin-left: 2px;
}
.tel > span {
	color: #fff;
	font-size: 14px;
	height: 30px;
	line-height: 30px;
	margin-left: 2px;
}

/* 内容 */
.content {
	color: #666;
	font-size: 15px;
}
.time {
	font-size: 13px;
	color: #999;
	margin-top: 10px;
}
.time > :nth-child(2) {
	float: right;
	color: #97abd1;
}
::v-deep .van-icon__image {
	width: 100%;
}
/* 底部评论转发 */
.triangle-up {
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-bottom: 10px solid #eee;
	margin-left: 10px;
}
.bottom {
	background: #eee;
	font-size: 13px;
	color: #666;
	padding: 5px 0;
	display: flex;
	flex-direction: row;
	align-items: center;
}
.bottom .item {
	display: flex;
	flex-direction: row;
	margin-left: 10px;
	/* align-items: center; */
}
.yanse {
	font-style: normal;
	font-size: 14px;
	color: #4395f5;
	margin: 0 5px 2px;
}
</style>
